]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
keyboard: Don't check for key.action using strict equality operator
authorJonas Dreßler <verdre@v0yd.nl>
Sun, 17 Nov 2024 18:01:23 +0000 (19:01 +0100)
committerJonas Dreßler <verdre@v0yd.nl>
Tue, 19 Nov 2024 19:23:25 +0000 (20:23 +0100)
A lot of keys have no action set. In that case key.action is `undefined`,
but the strict equality check of `action !== null` here will return true and
we'll enter the if-case anyway.

That's quite confusing and was not intended like that, so change the
comparison to a less-strict operator.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3286>

js/ui/keyboard.js

index 8bb5b0466d369afb3ad56cfc0d54657b45116770..a42c6ca872c701da7f51d20c7b08b892e41b3325 100644 (file)
@@ -1513,7 +1513,7 @@ export const Keyboard = GObject.registerClass({
                 });
             }
 
-            if (key.action !== null) {
+            if (key.action) {
                 button.connect('released', () => {
                     if (key.action === 'hide') {
                         this.close(true);